package bishi.meituan;

import java.util.*;

/**
 * @Classname Main2
 * @Description TODO
 * @Date 2021/9/11 16:37
 * @Created by ASUS
 */
public class Main2 {
    static class Station {
        int name;
        int cnt;

        public Station(int name, int cnt) {
            this.name = name;
            this.cnt = cnt;
        }
    }
    static Map<Integer, Station> map = new HashMap<>();
    
    static void solution() {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.nextLine().split(" ");
        int station_amount = Integer.parseInt(s[0]);
        int station_edges = Integer.parseInt(s[1]);
        int change_amount = Integer.parseInt(s[2]);
        for (int i = 0; i < station_edges; i++) {
            s = scanner.nextLine().split(" ");
            int a = Integer.parseInt(s[0]);
            int b = Integer.parseInt(s[1]);
            if (map.containsKey(a)) {
                Station station = map.getOrDefault(a, new Station(a, 0));
                station.cnt++;
                map.put(a, station);
            } else {
                map.put(a, new Station(a, 1));
            }
            if (map.containsKey(b)) {
                Station station = map.getOrDefault(b, new Station(b, 0));
                station.cnt++;
                map.put(b, station);
            } else {
                map.put(b, new Station(b, 1));
            }
        }
        for (int i = 0; i < change_amount; i++) {
            s = scanner.nextLine().split(" ");
            int a = Integer.parseInt(s[0]);
            int b = Integer.parseInt(s[1]);
            Station aSt = map.getOrDefault(a, new Station(a, 0));
            Station bSt = map.getOrDefault(b, new Station(b, 0));
            map.remove(a);
            map.remove(b);
            map.put(a, bSt);
            map.put(b, aSt);
        }
        List<String> res = new ArrayList<>();
        for (int i = 0; i < station_amount; i++) {
            res.add(String.valueOf(map.get(i+1).cnt));
        }
        System.out.println(String.join(" ", res));
    }

    public static void main(String[] args) {
        solution();
    }
}
